package com.training.java.core.collections.one;


public class Car implements Comparable<Car> {
	
	private String make;
	private String model;
	private int year;
	private String color;
	private String vinNumber;

	public Car(String make, String model, int year, String vinNumber) {
		super();
		this.make = make;
		this.model = model;
		this.year = year;
		this.vinNumber = vinNumber;
	}
	
	public Car(String make, String model, int year) {
		super();
		this.make = make;
		this.model = model;
		this.year = year;
	}
	
	public String getMake() {
		return make;
	}

	public String getModel() {
		return model;
	}

	public int getYear() {
		return year;

	}

	public String getColor() {
		return color;
	}
	
	public String getvinNumber(){
		return vinNumber;
	}
	
	@Override
	public boolean equals(Object obj) {
		
		Car that = (Car) obj;
		
		if(this.vinNumber.equals(that.vinNumber))
		{
			return true;
		} else {
			return false;
		}
		
	}		

	@Override
	public int hashCode() {
		return this.vinNumber.hashCode();
	}

	@Override
	public int compareTo(Car that) {
		return this.make.compareTo(that.make);
	}
}
